package com.itr.kbm.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "EMPLOYEE")
@DynamicInsert
@DynamicUpdate
public class Employee extends BaseObject {

	private static final long serialVersionUID = 1L;
	private String nik;
	private String nama;
	private String personalArea;
	private String psa;
	private String vPsa;
	private String kodeDivisi;
	private String kodeLoker;
	private String loker;
	private String kodePosisi;
	private String posisi;
	private Date tglMliKerja;
	private String kerjaBantu;
	private String band;
	private String klas;
	private String tmpLahir;
	private Date tglLahir;
	private String gender;
	private Date tglCapeg;
	private Date tglPensiunNorm;
	private String alamat;
	private String kota;
	private String status;
	private String agama;
	private double gadas;
	private double perumahan;
	private double koptel;
	private double thp;
	private double sepertigaThp;

	public Employee() {
	};

	public Employee(String nik, String nama, String personalArea, String psa,
			String vPsa, String kodeDivisi, String kodeLoker, String loker,
			String kodePosisi, String posisi, Date tglMliKerja,
			String kerjaBantu, String band, String klas, String tmpLahir,
			Date tglLahir, String gender, Date tglCapeg, Date tglPensiunNorm,
			String alamat, String kota, String status, String agama,
			double gadas, double perumahan, double koptel, double thp,
			double sepertigaThp) {
		super();
		this.nik = nik;
		this.nama = nama;
		this.personalArea = personalArea;
		this.psa = psa;
		this.vPsa = vPsa;
		this.kodeDivisi = kodeDivisi;
		this.kodeLoker = kodeLoker;
		this.loker = loker;
		this.kodePosisi = kodePosisi;
		this.posisi = posisi;
		this.tglMliKerja = tglMliKerja;
		this.kerjaBantu = kerjaBantu;
		this.band = band;
		this.klas = klas;
		this.tmpLahir = tmpLahir;
		this.tglLahir = tglLahir;
		this.gender = gender;
		this.tglCapeg = tglCapeg;
		this.tglPensiunNorm = tglPensiunNorm;
		this.alamat = alamat;
		this.kota = kota;
		this.status = status;
		this.agama = agama;
		this.gadas = gadas;
		this.perumahan = perumahan;
		this.koptel = koptel;
		this.thp = thp;
		this.sepertigaThp = sepertigaThp;
	}

	@Id
	@Column(name = "NIK")
	public String getNik() {
		return nik;
	}

	public void setNik(String nik) {
		this.nik = nik;
	}

	@Column(name = "NAMA")
	public String getNama() {
		return nama;
	}

	public void setNama(String nama) {
		this.nama = nama;
	}

	@Column(name = "PERSONALAREA")
	public String getPersonalArea() {
		return personalArea;
	}

	public void setPersonalArea(String personalArea) {
		this.personalArea = personalArea;
	}

	@Column(name = "PSA")
	public String getPsa() {
		return psa;
	}

	public void setPsa(String psa) {
		this.psa = psa;
	}

	@Column(name = "VPSA")
	public String getvPsa() {
		return vPsa;
	}

	public void setvPsa(String vPsa) {
		this.vPsa = vPsa;
	}

	@Column(name = "KODEDIVISI")
	public String getKodeDivisi() {
		return kodeDivisi;
	}

	public void setKodeDivisi(String kodeDivisi) {
		this.kodeDivisi = kodeDivisi;
	}

	@Column(name = "KODELOKER")
	public String getKodeLoker() {
		return kodeLoker;
	}

	public void setKodeLoker(String kodeLoker) {
		this.kodeLoker = kodeLoker;
	}

	@Column(name = "LOKER")
	public String getLoker() {
		return loker;
	}

	public void setLoker(String loker) {
		this.loker = loker;
	}

	@Column(name = "KODEPOSISI")
	public String getKodePosisi() {
		return kodePosisi;
	}

	public void setKodePosisi(String kodePosisi) {
		this.kodePosisi = kodePosisi;
	}

	@Column(name = "POSISI")
	public String getPosisi() {
		return posisi;
	}

	public void setPosisi(String posisi) {
		this.posisi = posisi;
	}

	@Column(name = "TGLMLIKERJA")
	public Date getTglMliKerja() {
		return tglMliKerja;
	}

	public void setTglMliKerja(Date tglMliKerja) {
		this.tglMliKerja = tglMliKerja;
	}

	@Column(name = "KERJABANTU")
	public String getKerjaBantu() {
		return kerjaBantu;
	}

	public void setKerjaBantu(String kerjaBantu) {
		this.kerjaBantu = kerjaBantu;
	}

	@Column(name = "BAND")
	public String getBand() {
		return band;
	}

	public void setBand(String band) {
		this.band = band;
	}

	@Column(name = "KLAS")
	public String getKlas() {
		return klas;
	}

	public void setKlas(String klas) {
		this.klas = klas;
	}

	@Column(name = "TMPLAHIR")
	public String getTmpLahir() {
		return tmpLahir;
	}

	public void setTmpLahir(String tmpLahir) {
		this.tmpLahir = tmpLahir;
	}

	@Column(name = "TGLLAHIR")
	public Date getTglLahir() {
		return tglLahir;
	}

	public void setTglLahir(Date tglLahir) {
		this.tglLahir = tglLahir;
	}

	@Column(name = "GENDER")
	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Column(name = "TGLCAPEG")
	public Date getTglCapeg() {
		return tglCapeg;
	}

	public void setTglCapeg(Date tglCapeg) {
		this.tglCapeg = tglCapeg;
	}

	@Column(name = "TGLPENSIUNNORM")
	public Date getTglPensiunNorm() {
		return tglPensiunNorm;
	}

	public void setTglPensiunNorm(Date tglPensiunNorm) {
		this.tglPensiunNorm = tglPensiunNorm;
	}

	@Column(name = "ALAMAT")
	public String getAlamat() {
		return alamat;
	}

	public void setAlamat(String alamat) {
		this.alamat = alamat;
	}

	@Column(name = "KOTA")
	public String getKota() {
		return kota;
	}

	public void setKota(String kota) {
		this.kota = kota;
	}

	@Column(name = "STATUS")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "AGAMA")
	public String getAgama() {
		return agama;
	}

	public void setAgama(String agama) {
		this.agama = agama;
	}

	@Column(name = "GADAS")
	public double getGadas() {
		return gadas;
	}

	public void setGadas(double gadas) {
		this.gadas = gadas;
	}

	@Column(name = "PERUMAHAN")
	public double getPerumahan() {
		return perumahan;
	}

	public void setPerumahan(double perumahan) {
		this.perumahan = perumahan;
	}

	@Column(name = "KOPTEL")
	public double getKoptel() {
		return koptel;
	}

	public void setKoptel(double koptel) {
		this.koptel = koptel;
	}

	@Column(name = "THP")
	public double getThp() {
		return thp;
	}

	public void setThp(double thp) {
		this.thp = thp;
	}

	@Column(name = "SEPERTIGATHP")
	public double getSepertigaThp() {
		return sepertigaThp;
	}

	public void setSepertigaThp(double sepertigaThp) {
		this.sepertigaThp = sepertigaThp;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((agama == null) ? 0 : agama.hashCode());
		result = prime * result + ((alamat == null) ? 0 : alamat.hashCode());
		result = prime * result + ((band == null) ? 0 : band.hashCode());
		long temp;
		temp = Double.doubleToLongBits(gadas);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((gender == null) ? 0 : gender.hashCode());
		result = prime * result
				+ ((kerjaBantu == null) ? 0 : kerjaBantu.hashCode());
		result = prime * result + ((klas == null) ? 0 : klas.hashCode());
		result = prime * result
				+ ((kodeDivisi == null) ? 0 : kodeDivisi.hashCode());
		result = prime * result
				+ ((kodeLoker == null) ? 0 : kodeLoker.hashCode());
		result = prime * result
				+ ((kodePosisi == null) ? 0 : kodePosisi.hashCode());
		temp = Double.doubleToLongBits(koptel);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((kota == null) ? 0 : kota.hashCode());
		result = prime * result + ((loker == null) ? 0 : loker.hashCode());
		result = prime * result + ((nama == null) ? 0 : nama.hashCode());
		result = prime * result + ((nik == null) ? 0 : nik.hashCode());
		result = prime * result
				+ ((personalArea == null) ? 0 : personalArea.hashCode());
		temp = Double.doubleToLongBits(perumahan);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((posisi == null) ? 0 : posisi.hashCode());
		result = prime * result + ((psa == null) ? 0 : psa.hashCode());
		temp = Double.doubleToLongBits(sepertigaThp);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result
				+ ((tglCapeg == null) ? 0 : tglCapeg.hashCode());
		result = prime * result
				+ ((tglLahir == null) ? 0 : tglLahir.hashCode());
		result = prime * result
				+ ((tglMliKerja == null) ? 0 : tglMliKerja.hashCode());
		result = prime * result
				+ ((tglPensiunNorm == null) ? 0 : tglPensiunNorm.hashCode());
		temp = Double.doubleToLongBits(thp);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result
				+ ((tmpLahir == null) ? 0 : tmpLahir.hashCode());
		result = prime * result + ((vPsa == null) ? 0 : vPsa.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Employee other = (Employee) obj;
		if (agama == null) {
			if (other.agama != null)
				return false;
		} else if (!agama.equals(other.agama))
			return false;
		if (alamat == null) {
			if (other.alamat != null)
				return false;
		} else if (!alamat.equals(other.alamat))
			return false;
		if (band == null) {
			if (other.band != null)
				return false;
		} else if (!band.equals(other.band))
			return false;
		if (Double.doubleToLongBits(gadas) != Double
				.doubleToLongBits(other.gadas))
			return false;
		if (gender == null) {
			if (other.gender != null)
				return false;
		} else if (!gender.equals(other.gender))
			return false;
		if (kerjaBantu == null) {
			if (other.kerjaBantu != null)
				return false;
		} else if (!kerjaBantu.equals(other.kerjaBantu))
			return false;
		if (klas == null) {
			if (other.klas != null)
				return false;
		} else if (!klas.equals(other.klas))
			return false;
		if (kodeDivisi == null) {
			if (other.kodeDivisi != null)
				return false;
		} else if (!kodeDivisi.equals(other.kodeDivisi))
			return false;
		if (kodeLoker == null) {
			if (other.kodeLoker != null)
				return false;
		} else if (!kodeLoker.equals(other.kodeLoker))
			return false;
		if (kodePosisi == null) {
			if (other.kodePosisi != null)
				return false;
		} else if (!kodePosisi.equals(other.kodePosisi))
			return false;
		if (Double.doubleToLongBits(koptel) != Double
				.doubleToLongBits(other.koptel))
			return false;
		if (kota == null) {
			if (other.kota != null)
				return false;
		} else if (!kota.equals(other.kota))
			return false;
		if (loker == null) {
			if (other.loker != null)
				return false;
		} else if (!loker.equals(other.loker))
			return false;
		if (nama == null) {
			if (other.nama != null)
				return false;
		} else if (!nama.equals(other.nama))
			return false;
		if (nik == null) {
			if (other.nik != null)
				return false;
		} else if (!nik.equals(other.nik))
			return false;
		if (personalArea == null) {
			if (other.personalArea != null)
				return false;
		} else if (!personalArea.equals(other.personalArea))
			return false;
		if (Double.doubleToLongBits(perumahan) != Double
				.doubleToLongBits(other.perumahan))
			return false;
		if (posisi == null) {
			if (other.posisi != null)
				return false;
		} else if (!posisi.equals(other.posisi))
			return false;
		if (psa == null) {
			if (other.psa != null)
				return false;
		} else if (!psa.equals(other.psa))
			return false;
		if (Double.doubleToLongBits(sepertigaThp) != Double
				.doubleToLongBits(other.sepertigaThp))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		if (tglCapeg == null) {
			if (other.tglCapeg != null)
				return false;
		} else if (!tglCapeg.equals(other.tglCapeg))
			return false;
		if (tglLahir == null) {
			if (other.tglLahir != null)
				return false;
		} else if (!tglLahir.equals(other.tglLahir))
			return false;
		if (tglMliKerja == null) {
			if (other.tglMliKerja != null)
				return false;
		} else if (!tglMliKerja.equals(other.tglMliKerja))
			return false;
		if (tglPensiunNorm == null) {
			if (other.tglPensiunNorm != null)
				return false;
		} else if (!tglPensiunNorm.equals(other.tglPensiunNorm))
			return false;
		if (Double.doubleToLongBits(thp) != Double.doubleToLongBits(other.thp))
			return false;
		if (tmpLahir == null) {
			if (other.tmpLahir != null)
				return false;
		} else if (!tmpLahir.equals(other.tmpLahir))
			return false;
		if (vPsa == null) {
			if (other.vPsa != null)
				return false;
		} else if (!vPsa.equals(other.vPsa))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Employee ["
				+ (nik != null ? "nik=" + nik + ", " : "")
				+ (nama != null ? "nama=" + nama + ", " : "")
				+ (personalArea != null ? "personalArea=" + personalArea + ", "
						: "")
				+ (psa != null ? "psa=" + psa + ", " : "")
				+ (vPsa != null ? "vPsa=" + vPsa + ", " : "")
				+ (kodeDivisi != null ? "kodeDivisi=" + kodeDivisi + ", " : "")
				+ (kodeLoker != null ? "kodeLoker=" + kodeLoker + ", " : "")
				+ (loker != null ? "loker=" + loker + ", " : "")
				+ (kodePosisi != null ? "kodePosisi=" + kodePosisi + ", " : "")
				+ (posisi != null ? "posisi=" + posisi + ", " : "")
				+ (tglMliKerja != null ? "tglMliKerja=" + tglMliKerja + ", "
						: "")
				+ (kerjaBantu != null ? "kerjaBantu=" + kerjaBantu + ", " : "")
				+ (band != null ? "band=" + band + ", " : "")
				+ (klas != null ? "klas=" + klas + ", " : "")
				+ (tmpLahir != null ? "tmpLahir=" + tmpLahir + ", " : "")
				+ (tglLahir != null ? "tglLahir=" + tglLahir + ", " : "")
				+ (gender != null ? "gender=" + gender + ", " : "")
				+ (tglCapeg != null ? "tglCapeg=" + tglCapeg + ", " : "")
				+ (tglPensiunNorm != null ? "tglPensiunNorm=" + tglPensiunNorm
						+ ", " : "")
				+ (alamat != null ? "alamat=" + alamat + ", " : "")
				+ (kota != null ? "kota=" + kota + ", " : "")
				+ (status != null ? "status=" + status + ", " : "")
				+ (agama != null ? "agama=" + agama + ", " : "") + "gadas="
				+ gadas + ", perumahan=" + perumahan + ", koptel=" + koptel
				+ ", thp=" + thp + ", sepertigaThp=" + sepertigaThp + "]";
	}

}
